﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace PCLawPrototype
{
    public partial class NewFastTask : Form
    {
        private long _tmi = 0;
        public NewFastTask()
        {
            InitializeComponent();
        }

        private void btnPUClient_Click(object sender, EventArgs e)
        {
            PUClientFrm puClientFrm = new PUClientFrm();
            puClientFrm.Show();
        }

        private void btnPUMatter_Click(object sender, EventArgs e)
        {
            PUMatterFrm puMatterFrm = new PUMatterFrm();
            puMatterFrm.Show();
        }

        private void tmrCounting_Tick(object sender, EventArgs e)
        {
            _tmi++;
            int hr = (int)_tmi/3600;
            var a = _tmi - (hr*3600);
            int mn = (int) a/60;
            a = a - (mn*60);
            int sec = (int)a;

            txtTime.Text = hr.ToString("00") + ":" + mn.ToString("00") + ":" + sec.ToString("00");
        }

        private void btnStartTimer_Click(object sender, EventArgs e)
        {
            if (btnStartTimer.Text.Equals("Start"))
            {
                tmrCounting.Start();
                btnStartTimer.Text = "Finish";
            }
            else
            {
                tmrCounting.Stop();
                btnStartTimer.Text = "Start";
            }
        }

        private void btnSave_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Task Saved!");
            this.Close();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnHelp_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Help will be shown!");
        }
    }
}
